package com.ruoyi.qsng.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.SnowFlakeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.qsng.mapper.KInvoiceMapper;
import com.ruoyi.qsng.domain.KInvoice;
import com.ruoyi.qsng.service.IKInvoiceService;

/**
 * 发票管理Service业务层处理
 * 
 * @author kanglou
 * @date 2023-06-07
 */
@Service
public class KInvoiceServiceImpl implements IKInvoiceService 
{
    @Autowired
    private KInvoiceMapper kInvoiceMapper;

    /**
     * 查询发票管理
     * 
     * @param id 发票管理主键
     * @return 发票管理
     */
    @Override
    public KInvoice selectKInvoiceById(String id)
    {
        return kInvoiceMapper.selectKInvoiceById(id);
    }

    /**
     * 查询发票管理列表
     * 
     * @param kInvoice 发票管理
     * @return 发票管理
     */
    @Override
    public List<KInvoice> selectKInvoiceList(KInvoice kInvoice)
    {
        return kInvoiceMapper.selectKInvoiceList(kInvoice);
    }

    /**
     * 新增发票管理
     * 
     * @param kInvoice 发票管理
     * @return 结果
     */
    @Override
    public int insertKInvoice(KInvoice kInvoice)
    {
        kInvoice.setId(SnowFlakeUtil.getNextId());
        kInvoice.setCreateTime(DateUtils.getNowDate());
        return kInvoiceMapper.insertKInvoice(kInvoice);
    }

    /**
     * 修改发票管理
     * 
     * @param kInvoice 发票管理
     * @return 结果
     */
    @Override
    public int updateKInvoice(KInvoice kInvoice)
    {
        kInvoice.setUpdateTime(DateUtils.getNowDate());
        return kInvoiceMapper.updateKInvoice(kInvoice);
    }

    /**
     * 批量删除发票管理
     * 
     * @param ids 需要删除的发票管理主键
     * @return 结果
     */
    @Override
    public int deleteKInvoiceByIds(String[] ids)
    {
        return kInvoiceMapper.deleteKInvoiceByIds(ids);
    }

    /**
     * 删除发票管理信息
     * 
     * @param id 发票管理主键
     * @return 结果
     */
    @Override
    public int deleteKInvoiceById(String id)
    {
        return kInvoiceMapper.deleteKInvoiceById(id);
    }
}
